<!DOCTYPE html>
<html><head>
    <title>购物车</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="Keywords" content="书">

    <link href="__PUBLIC__/home/css/public.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/css/yg.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/css/cart.css" rel="stylesheet" type="text/css">


</head>
<body id="body">
    <div class="w w1280">


<!------- 顶部工具栏 ------>
<div class="site-nav">
    <div class="wrap">
        <ul class="fl">
           <li>欢迎光临！</li>
                </ul>

                <ul class="fr">

                    <li class="mobile">
                        <div class="tit"><a href="__MODULE__/Index/index">首页<s></s></a></div>
                        
                    </li>
                    
                    <if condition="$V=SESSION('username')">
                    <li id="" style="">
                        <a rel="nofollow" href="__MODULE__/Collect/index">我的收藏</a>
                    </li>
                    <li id="" style="">
                        <a rel="nofollow" href="__MODULE__/User/index">会员中心</a>
                    </li>
                    <li id="" style="">
                        <a rel="nofollow" href="__MODULE__/Cart/index/goodsNum/1">去购物车</a>
                    </li>
                    <li id="_logout" style="">
                        <a href="__MODULE__/Login/logout" class="logout">[退出]</a>
                    </li>
                    <li id="" style="">
                        <a rel="nofollow"><{$V}></a>
                    </li>
                    <else/>
                    <li id="_register" style="">
                        <a rel="nofollow" href="__MODULE__/Register/index">[注册]</a>
                    </li>
                    <li id="_login" style="">
                        <a rel="nofollow" href="__MODULE__/Login/index">[登录]</a>
                    </li>
                    
                    </if>
                </ul>
            </div>
        </div>

        <!------- 头部 ------>
        <div class="header clearfix">
            <div class="wrap">
                <div class="logo">
                    <a href="#" target="_self"></a>
                    
                </div>
                <div class="steps">
                    <ul>
                        <li class="on"><b class="b1"></b><span>我的购物车</span></li>
                        <li><i></i><b class="b2"></b><span>填写订单信息</span></li>
                        <li><i></i><b class="b3"></b><span>成功提交订单</span></li>
                    </ul>
                </div>
            </div>
        </div>
        

<!-------  我的购物车 ------>
<div class="cart">
    <div class="wrap">
            <h2>
                我的购物车



<div class="city clearfix">
    


<div class="city-con">
    <div class="headline">
        <a>&gt;&gt;</a><a href="javascript:void()" v="64" aid="other">全国其它城市</a> 请根据您的收货地址选择
    </div>

    <div class="citylist border">
           
    </div>
</div>
</div>
                <a class="on-shopping" href="__MODULE__/index/index">继续购物 &gt; &gt;</a>
            </h2>

            <form action="__MODULE__/Order/index" method="post">
            <div class="cart-alert">
                <div class="cart-header">
                    <table class="cart-table">
                        <tbody>
                            <tr>
                                <th class="cart-t-check"><label><input  class="chkAll" type="checkbox">全选</label></th>
                                <th class="cart-t-info">商品信息</th>
                                <th class="cart-t-price">单价</th>
                                <th class="cart-t-num">购买数量</th>
                                <th class="cart-t-total">合计</th>
                                <th class="cart-t-opera">操作</th>
                            </tr>
                        </tbody>
                    </table>
                </div>
                    <div class="cart-list" id="theInsulationCan">


        <foreach name="mycart" item="mycart" key="k">

            <table class="cart-table">
                <tbody>
                    <tr>
                        <!-- <input name="goodsid[]" value="<{$mycart.goodsid}>" type="hidden"> -->
                        <td class="cart-t-check"><input name="goodsid[]" value="<{$mycart.goodsid}>" comid="67ef74af-36e9-4f71-b724-71992fdf7e07|1" type="checkbox" checked="checked"></td>
                        <td class="cart-t-img"><a href="__MODULE__/Goodsdetail/index/goodsid/<{$mycart.goodsid}>"><img src="__PUBLIC__/Upload/<{$mycart.goodspic}>"></a></td>
                        <td class="cart-t-info" style="width:480px;"><a href="#"><{$mycart.goodsname}></a></td>
                        <td class="cart-t-price">￥<{$mycart.goodsprice}></td>
                        <td class="cart-t-ub"><{$mycart.number}></td>
                        <td class="cart-t-total">￥<span id="xiaoji<{$k}>"><{$mycart.xiaoji}></span></td>
                        <td class="cart-t-opera">
                            <a href="__MODULE__/collect/add/goodsid/<{$mycart.goodsid}>" onclick="G.app.cart.module.addToFavor('67ef74af-36e9-4f71-b724-71992fdf7e07')">移入收藏</a>
                            <br>
                            <a href="__CONTROLLER__/del/goodsid/<{$mycart.goodsid}>" onclick="">删除</a>
                        </td>
                    </tr>

                </tbody>
            </table>

        </foreach>
            
<div id="theCart" style="display:none;">
    <span id="theTotalUB">0</span>
    <span id="theTotalPrice">125.00</span>
</div>

                    </div>
                    <!--选择保温箱-->
                <div class="cart-slct-box">
                </div>
                    <div class="settle-space"></div>
                    <div class="cart-footer clearfix settle">
                        <div class="wrap">
                            <div class="fl">
                                <a href="__CONTROLLER__/delall/userid/<{$mycart.userid}>" onclick="">清空购物车</a>
                            </div>
                            <div class="fr">
                                

                                    <span class="fs14">总价：<em>￥<span id="total">0</span></em></span>

                                    <input id="test" name="test" value="" type="hidden">
                                    <input id="" name="userid" value="<{$mycart.userid}>" type="hidden">

                                    
                                    <button class="btn" style="cursor:pointer;" onclick="fun()">去结算</button>
                                    <script type="text/javascript">
                                        var total=document.getElementById('total');
                                        var test=document.getElementById('test');
                                        function fun(){
                                           test.value=  total.innerHTML; 
                                        }
                                        
                                          
                                    </script>
                                
                            </div>
                        </div>
                    </div>
                </div>
                </form>

    </div>
</div>




  <!------- 页尾 ------>
        <include file="./Public/footer.html" />


    </div>
    <script src="__PUBLIC__/home/js/jquery.js"></script>
    <script type="text/javascript" src="__PUBLIC__/home/js/global-v2.js"></script>
    <script type="text/javascript" src="__PUBLIC__/home/js/tab.js"></script>
    <script type="text/javascript" src="__PUBLIC__/home/js/CartController.js"></script>
    <script type="text/javascript">
        //读取选中项
        function isSelectedAll() {
            var temp = true;
            if ($(".cart-list :checkbox").size() == 0) return false;
            $(".cart-list :checkbox").each(function (i, o) {
                if (!$(o).attr("checked")) {
                    temp = false;
                    return;
                }
            });
            return temp;
        }
        isSelectedAll();
        //计算总价
        function UpdatePanel() {
            if (isSelectedAll()) {
                $(".chkAll").attr("checked", "checked");
            }
            var total = 0.00;
            var ub = 0;
            $(".cart-list .cart-table tr[class!='zp']").each(function (i, o) {
                var cb = $(o).find("td.cart-t-check").find("input").attr("checked");
                if (cb) {
                    var u = $(o).find("td.cart-t-ub").html();
                    var t = $(o).find("td.cart-t-total").find("span").html();
                    if (u != "") {
                        ub += parseInt(u);
                    }
                    total += parseFloat(t);
                }
            });
            $(".cart-footer span.ub em").html(ub);
            $(".cart-footer span.fs14 em span").html(G.app.CartController.changeTwoDecimal_f(total));
        }
        UpdatePanel();

        $(function () {
            //选择城市
            $('.city').hover(function(){
                $(this).addClass('current');
            },function(){
                $(this).removeClass('current');
            });





        $(".cart-slct-box .chk input").click(
            function(){
                $("#insulationCan").toggle();    
            }
        );
        var sExchangeBuy=$(".preferential-buy").html();
        if($.trim(sExchangeBuy)=="")
        {
            $(".preferential-buy").hide()
        }else{
            $(".preferential-buy").html(sExchangeBuy);
        }


        //login popout
        $(".p-login .popout-con .title a.close").click(function(){
            $(".p-login").hide();
        });

        $(".city-con a").click(function(){
            var v = $(this).attr("v");
            var areaid = $(this).attr("aid");
            var name = $.trim($(this).text());
            if (v != "" && v != undefined) {
                $.ajax({
                    url: "/AjaxCart/SetAreaCookie?cityid=" + v + "&cityname=" + encodeURIComponent(name) + "&areaid=" + encodeURIComponent(areaid) + "&r=" + Math.random(),
                    success: function (data) {
                        if(data=="1"){
                            window.location.reload(true);
                        }
                    }
                });
            }
        });

    });
    //适应分辨率
    var screenWidth = window.screen.width;
    if (screenWidth < 1300) {
        document.write()
        $('.w').addClass('w1280');
    }
    //结算样式浮动
    $(window).scroll(scrollSettle);
    scrollSettle();
    function scrollSettle() {
        var spaceTop = $('.settle-space').offset().top,
            scrollTop = $(window).scrollTop(),
            windowHeight = $(window).height(),
            elementTop = spaceTop - windowHeight;
        if (elementTop < scrollTop) {
            $('.settle').removeClass('settle-fixed');
        }
        else {
            $('.settle').addClass('settle-fixed');
        }
    }

    
    
    </script>


</body></html>